//2009/10/20 19:49:11
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ReverseMagicalSource
{
public:
    int find(int source, int A)
    {
		long sum = 0;
		while(sum <= A)
		{
			sum = sum * 10 + source;
		}
		return sum;
    }
};
